<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>使用舍入方法的计算器</title>
</head>
<body>
<script>
    var myNumber = prompt('Enter the number to be rounded', '');
    document.write('<h3>The number you entered was ' + myNumber + '</h3>');
    document.write('<p>The rounding results for this number are</p>');
    document.write('<table width="350" border="1">');
    document.write('<tr><th>Medthod</th><th>Result</th></tr>');
    document.write('<tr><td>parseInt()</td><td>' + parseInt(myNumber, 10) + '</td></tr>');
    document.write('<tr><td>ceil()</td><td>' + Math.ceil(myNumber) + '</td></tr>');
    document.write('<tr><td>floor()</td><td>' + Math.floor(myNumber) + '</td></tr>');
    document.write('<tr><td>round()</td><td>' + Math.round(myNumber) + '</td></tr>');
</script>
</body>
</html>